<template>
  <div class="after-sale">
    <el-radio-group v-model="afterSaleVal">
      <el-radio :label="4">退款处理</el-radio>
      <el-radio :label="5">退货处理</el-radio>
      <el-radio :label="6">换货处理</el-radio>
    </el-radio-group>
    <div class="after-box">
      <el-button @click="close">取 消</el-button>
      <el-button type="primary" @click="save" :loading="saveLoading">确 定</el-button>
    </div>
  </div>
</template>
<script>
  export default {
    props: ['info'],
    data() {
      return {
        afterSaleVal: '',
        // 保存loading
        saveLoading: false,
      };
    },
    methods: {
      // 关闭
      close() {
        this.$emit('dialogCancel');
      },
      // 保存
      save() {
        this.saveLoading = true;
        this.$service.MallOrderTreat({ id: this.info, status: this.afterSaleVal }).then((res) => {
          this.saveLoading = true;
          this.$emit('dialogSubmit');
          this.$message.success('保存成功！');
        });
      },
    },
  };
</script>
<style lang="less" scoped>
  .after-sale {
    .after-box {
      text-align: right;
      margin-top: 20px;
    }
  }
</style>
